package cn.jianyongjie.basic.utils;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
* @Description: TODO
* @Author: Jian Yong Jie
* @Version: 1.0
* @Date:  2022/4/22 12:33
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class AjaxResult {

    public Boolean success = true;

    public String message = "操作成功!";

    public Object resultObj;


    public AjaxResult setSuccess(Boolean success) {
        this.success = success;
        return this;
    }

    public AjaxResult setResultObj(Object resultObj) {
        this.resultObj = resultObj;
        return this;
    }

    public AjaxResult setMessage(String message) {
        this.message = message;
        return this;
    }

    public static AjaxResult success(){
        return new AjaxResult();
    }

    public static AjaxResult error(){
        return new AjaxResult().setSuccess(false).setMessage("系统繁忙,请稍后再试!");
    }
}
